package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 业务日志表单信息历史表
 *
 * @author chenzh
 * @since 2020-06-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("OPLOG_TABLE_CHANGEH")
@ApiModel(value = "OplogTableChangeh对象", description = "业务日志表单信息历史表")
public class OplogTableChangeh extends Model<OplogTableChangeh> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "变动ID")
    @TableId(value = "CHANGE_ID", type = IdType.INPUT)
    private Long changeId;

    @ApiModelProperty(value = "操作日志id")
    @TableField("OPLOG_ID")
    private Long oplogId;

    @ApiModelProperty(value = "业务年月")
    @TableField("DATE_YM")
    private Integer dateYm;

    @ApiModelProperty(value = "操作类型 10 新增 20 修改 30逻辑删除 31 物理删除")
    @TableField("OP_TYPE")
    private String opType;

    @ApiModelProperty(value = "操作的表")
    @TableField("OP_TABLE")
    private String opTable;

    @ApiModelProperty(value = "唯一id")
    @TableField("UNIQUE_VALUE")
    private String uniqueValue;

    @ApiModelProperty(value = "表实体类路径")
    @TableField("BEAN_CLASS_PATH")
    private String beanClassPath;

    @ApiModelProperty(value = "表处理类名称")
    @TableField("MAPPER_CLASS_NAME")
    private String mapperClassName;

    @ApiModelProperty(value = "表数据信息")
    @TableField("TABLE_JSON")
    private String tableJson;

    @ApiModelProperty(value = "变动信息 记录变动前后数据")
    @TableField("CHANG_JSON")
    private String changJson;

    @ApiModelProperty(value = "上次记录")
    @TableField("SUP_CHANGE_ID")
    private Long supChangeId;

    @ApiModelProperty(value = "唯一id字段")
    @TableField("DATA_TYPE")
    private String dataType;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "排列顺序")
    @TableField("ORDER_NO")
    private Integer orderNo;

    @ApiModelProperty(value = "有效标志 0 有效 1无效")
    @TableField("`STATUS`")
    private String status;

    @ApiModelProperty(value = "是否最后一条数据")
    @TableField("LAST_FLAG")
    private String lastFlag;

    @Override
    public Serializable pkVal() {
        return this.changeId;
    }
}
